package config

import "github.com/goravel/framework/facades"

type JavaScript struct {
    Src         string `json:"src"`
    Integrity   string `json:"integrity"`
    CrossOrigin string `json:"crossorigin"`
}

type Stylesheet struct {
    Href        string `json:"href"`
    Integrity   string `json:"integrity"`
    CrossOrigin string `json:"crossorigin"`
}

func init() {
    config := facades.Config()

    config.Add("web", map[string]any{
        "scripts": []JavaScript{
            {
                Src:        "https://cdn.jsdelivr.net/npm/overlayscrollbars@2.10.1/browser/overlayscrollbars.browser.es6.min.js",
                Integrity:  "sha256-dghWARbRe2eLlIJ56wNB+b760ywulqK3DzZYEpsg2fQ=",
                CrossOrigin: "anonymous",
            },
            {
                Src:        "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js",
                Integrity:  "sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r",
                CrossOrigin: "anonymous",
            },
            {
                Src:        "https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js",
                Integrity:  "sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy",
                CrossOrigin: "anonymous",
            },
        },

        "links": []Stylesheet{
            {
                Href:        "https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.0.12/index.css",
                Integrity:   "sha256-tXJfXfp6Ewt1ilPzLDtQnJV4hclT9XuaZUKyUvmyr+Q=",
                CrossOrigin: "anonymous",
            },
            {
                Href:        "https://cdn.jsdelivr.net/npm/overlayscrollbars@2.10.1/styles/overlayscrollbars.min.css",
                Integrity:   "sha256-tZHrRjVqNSRyWg2wbppGnT833E/Ys0DHWGwT04GiqQg=",
                CrossOrigin: "anonymous",
            },
            {
                Href:        "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css",
                Integrity:   "sha256-9kPW/n5nn53j4WMRYAxe9c1rCY96Oogo/MKSVdKzPmI=",
                CrossOrigin: "anonymous",
            },
        },
    })
}
